import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/styles/public.scss' // global css
import App from './App.vue'
import router from './router'
import store from './store'
import iView from 'iview';
import 'iview/dist/styles/iview.css'; 

import * as uni from './js/uni.webview'// 直接引入
import { initUniBridge } from './js/uniBridge';
// 给所有组件的 this 注入 uni
Vue.prototype.uni = uni
// window.uni=uni
initUniBridge(uni);

Vue.use(ElementUI);
Vue.use(iView);
Vue.config.productionTip = false


// function setRem() {
//   const baseSize = 16; // 基准大小，根据设计稿调整
//   const scale = document.documentElement.clientWidth / 1600; // 以1600为基准宽度
//   document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px';
// }

// window.addEventListener('resize', setRem);
// setRem();

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
